package nccu.webapp.controller;

import nccu.model.ExamReport;
import nccu.service.GenericManager;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping("/examreports*")
public class ExamReportController {

    private GenericManager<ExamReport, Long> examReportManager;

    @Autowired
    public void setBankManager(@Qualifier("examReportManager") GenericManager<ExamReport, Long> examReportManager) {
        this.examReportManager = examReportManager;
    }

    @RequestMapping(method = RequestMethod.GET)
    public ModelAndView handleRequest()
    throws Exception {
        return new ModelAndView().addObject(examReportManager.getAll());
    }
}
